]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
chrome: try find fullscreen windows only on current workspace
authorMaxim Ermilov <zaspire@rambler.ru>
Tue, 8 Feb 2011 01:05:30 +0000 (04:05 +0300)
committerMaxim Ermilov <zaspire@rambler.ru>
Tue, 8 Feb 2011 20:43:35 +0000 (23:43 +0300)
https://bugzilla.gnome.org/show_bug.cgi?id=641677

js/ui/chrome.js
js/ui/main.js
js/ui/workspace.js

index c90390fd487864ff928a5a958d209aa6320f4086..4fbaf8d5f803dfad80e68b041b5c9478005b8dce 100644 (file)
@@ -233,7 +233,7 @@ Chrome.prototype = {
     },
 
     _windowsRestacked: function() {
-        let windows = global.get_window_actors();
+        let windows = Main.getWindowActorsForWorkspace(global.screen.get_active_workspace_index());
         let primary = global.get_primary_monitor();
 
         // The chrome layer should be visible unless there is a window
index 8f8725bec0d8f283e1fda5d639b4f6a728d412d9..204ccd4f913d020c06b3a5bd5de56103909eec6d 100644 (file)
@@ -303,6 +303,17 @@ function _relayout() {
     overview.hide();
 }
 
+function isWindowActorDisplayedOnWorkspace(win, workspaceIndex) {
+    return win.get_workspace() == workspaceIndex ||
+        (win.get_meta_window() && win.get_meta_window().is_on_all_workspaces());
+}
+
+function getWindowActorsForWorkspace(workspaceIndex) {
+    return global.get_window_actors().filter(function (win) {
+        return isWindowActorDisplayedOnWorkspace(win, workspaceIndex);
+    });
+}
+
 // metacity-clutter currently uses the same prefs as plain metacity,
 // which probably means we'll be starting out with multiple workspaces;
 // remove any unused ones. (We do this from an idle handler, because
index ebb3f1e9f86d8ab29ce4109a60b0f6877c17d854..09faf91deb3fd38e45aa12dcb768ea32ad12b531 100644 (file)
@@ -552,7 +552,7 @@ Workspace.prototype = {
         this.actor.height = global.screen_height;
         this.scale = 1.0;
 
-        let windows = global.get_window_actors().filter(this._isMyWindow, this);
+        let windows = Main.getWindowActorsForWorkspace(this.metaWorkspace.index());
 
         // Create clones for remaining windows that should be
         // visible in the Overview
@@ -1308,8 +1308,7 @@ Workspace.prototype = {
 
     // Tests if @win belongs to this workspaces
     _isMyWindow : function (win) {
-        return win.get_workspace() == this.metaWorkspace.index() ||
-            (win.get_meta_window() && win.get_meta_window().is_on_all_workspaces());
+        return Main.isWindowActorDisplayedOnWorkspace(win, this.metaWorkspace.index());
     },
 
     // Tests if @win should be shown in the Overview